/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import { CustomRequestOptions_ } from '@/http/types';

import * as API from './types';

/** 查询聊天记录 查询聊天记录 GET /message/private/history */
export function messagePrivateHistoryUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.MessagePrivateHistoryUsingGetParams;
  options?: CustomRequestOptions_;
}) {
  return request<API.ResultListPrivateMessageVO>('/message/private/history', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 获取最大已读消息的id 获取某个会话中已读消息的最大id GET /message/private/maxReadedId */
export function messagePrivateMaxReadedIdUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.MessagePrivateMaxReadedIdUsingGetParams;
  options?: CustomRequestOptions_;
}) {
  return request<API.ResultLong>('/message/private/maxReadedId', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 拉取离线消息 拉取离线消息,消息将通过webscoket异步推送 GET /message/private/pullOfflineMessage */
export function messagePrivatePullOfflineMessageUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.MessagePrivatePullOfflineMessageUsingGetParams;
  options?: CustomRequestOptions_;
}) {
  return request<API.Result>('/message/private/pullOfflineMessage', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 消息已读 将会话中接收的消息状态置为已读 PUT /message/private/readed */
export function messagePrivateReadedUsingPut({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.MessagePrivateReadedUsingPutParams;
  options?: CustomRequestOptions_;
}) {
  return request<API.Result>('/message/private/readed', {
    method: 'PUT',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 撤回消息 撤回私聊消息 DELETE /message/private/recall/${param0} */
export function messagePrivateRecallIdUsingDelete({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.MessagePrivateRecallIdUsingDeleteParams;
  options?: CustomRequestOptions_;
}) {
  const { id: param0, ...queryParams } = params;

  return request<API.ResultPrivateMessageVO>(
    `/message/private/recall/${param0}`,
    {
      method: 'DELETE',
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 发送消息 发送私聊消息 POST /message/private/send */
export function messagePrivateSendUsingPost({
  body,
  options,
}: {
  body: API.PrivateMessageDTO;
  options?: CustomRequestOptions_;
}) {
  return request<API.ResultPrivateMessageVO>('/message/private/send', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
